package com.amgl.mobike.app;

import android.app.Application;

import com.amgl.mobike.BuildConfig;
import com.amgl.mobike.utils.CommonUtils;

import timber.log.Timber;

/**
 * Created by 阿木 on 2017/5/27.
 */

public class BaseApplication extends Application {
    private static BaseApplication sInstance = null;

    public static BaseApplication getInstance() {
        return sInstance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        sInstance = this;
        if (CommonUtils.isMainProcess(this)) {
            init();
        }
    }

    private void init() {
        if (BuildConfig.DEBUG) {
            Timber.plant(new Timber.DebugTree());
        }
    }
}
